<% content_for :sidebar do %>
  <h1>Listing Channels</h1>
  <%= sidebar_button_link 'New Channel', new_channel_path unless cannot? :create, Channel %>
<% end %>

<table id="channels" class="generic_datatable table table-striped table-bordered" >
  <thead>
    <tr>
      <th>Person</th>
      <th>Name</th>
      <th>Content</th>
      <th>Priority</th>
      <th>Category</th>
      <th>Carrier</th>
      <th>Last verified</th>
      <th>Usage</th>
      <th></th>
    </tr>
  </thead>

<% @channels.each do |channel| %>
  <tr>
    <td><%= channel.person_id %></td>
    <td><%= channel.name %></td>
    <td><%= channel.content %></td>
    <td><%= channel.priority %></td>
    <td><%= channel.category %></td>
    <td><%= channel.carrier %></td>
    <td><%= channel.last_verified %></td>
    <td><%= channel.usage %></td>
    <td><%= table_button_link 'Edit', edit_channel_path(channel) unless cannot? :edit, channel %></td>
  </tr>
<% end %>
</table>

<br/>

<%= independent_button_link 'New Channel', new_channel_path %>
